package com.patterns.prototype.commomPrototyoe;

/**
 * Created by Xiao Yiyun on 2017/4/25.
 * 原型模式的实现代码
 * 实现Cloneable接口，标记这个对象可能被拷贝
 */
public class PrototypeClass implements Cloneable {
    //覆盖Object类的clone()方法
    public PrototypeClass clone() {
        PrototypeClass prototypeClass = null;
        try {
            prototypeClass = (PrototypeClass)super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return prototypeClass;
    }
}
